package com.zk.nakedfowl.powerManager.dao;

import com.zk.nakedfowl.powerManager.pojo.UserRole;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * 数据访问接口
 * @author Administrator
 *
 */
public interface UserRoleDao extends JpaRepository<UserRole,String>,JpaSpecificationExecutor<UserRole>{

   @Query(value = "select * from sys_user_role where userId=?1;",nativeQuery = true)
   List<UserRole> findByUserId(String userId);
    @Query(value = "select * from sys_user_role where roleId=?1;",nativeQuery = true)
    List<UserRole> findByRoleId(String roleId);



}
